You are here: Database

Configure Tomcat Server

To configure the Tomcat server, follow these steps:

  1. Navigate to <Tomcat Installation Directory>/bin
  2. Modify startup.sh with following parameters:
    Parameters (for JVM)RequiredDescription
    -Xmx2048m YesMinimum Heap size: 2GB
    -Xms2048m YesMaximum Heap size: 2GB
    -XX:MaxPermSize=512m Yes One fourth of the main Heap memory assigned
    -XX:+UseConcMarkSweepGCYes This is a recommended setting
    -XX:HeapDumpPath OptionalThis parameter is to get Heap Dump Path
    -Dkpns.configLocation Yes This is the directory where the configResource.properties, database.properties, and kmslog4j2. xml files must be placed.
    For example, if the location is/data/kpns-config, then you must specify the property as -Dkpns.configLocation=/data/kpns-config
    -Dhibernate.dialect

    Enables you to connect to the database. JDBC has to be configured on the AppServer level.

    DB2=org.hibernate.dialect.DB2Dialect- per database

    SQL= com.kony.kms.dialect.KMSSQLServerDialect

    Oracle= org.hibernate.dialect.Oracle10gDialect

    MYSQL= org.hibernate.dialect.MySQLDialect

    Note: -Dhibernate.dialect : This parameter mentioned in the above table is required only for Oracle database.

    Example: This is a sample for above mentioned parameters.

    set JAVA_OPTS="-server -Xms2048m -Xmx2048m -XX:NewSize=512m -XX:MaxNewSize=256m -XX:PermSize=512m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/kpns/logs/heapdumps -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dnet.spy.log.LoggerImpl=net.spy.memcached.compat.log.Log4JLogger -Dfile.encoding=UTF8 -Dkpns.configLocation=/data/kpns-config/"
  3. Configure the following JVM parameters:
    -Xms2048m –Xmx2048m -Dkpns.configLocation=<path of the kpns config location extracted from kpns-resources.tar>
  4. Save the configuration.
  5. Configure the datasource.

    Database

    MySQL

    1. Copy  mysql-connector-java-5.1.26-bin.jar to  <Tomcat installation directory>/lib
    2. Navigate to <Tomcat installation directory>/conf
    3. Add datasource context.xml as given below:
      <Resource name="jdbc/kpnsdb" auth="Container" type="javax.sql.DataSource" scope="Shareable" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" maxActive="50" minIdle="1" maxIdle="10" testWhileIdle="true" maxWait="10000" initialSize="10" testOnBorrow="true" validationQuery="SELECT 1" removeAbandoned="false"
      removeAbandonedTimeout="180" logAbandoned="false" username="username" password="password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://<host>:<port>/
      <database>?autoReconnect=true&amp;
      useUnicode=yes&amp;characterEncoding=UTF-8&amp;cachePrepStmts=true&amp;
      cacheCallableStmts
      =true&amp;cacheServerConfiguration=true&amp;useLocalSessionState
      =true&amp;elideSetAutoCommits
      =true&amp;alwaysSendSetIsolation=false&amp;enableQueryTimeouts=false&amp;
      
      rewriteBatchedStatements=true&amp;max_allowed_packet=104857600 "/>
    4. Replace the values given below in above configuration.
      Configuration ValueDescription
      hostDatabase server IP/name
      portDatabase server port
      username Database user name
      passwordDatabase password
      databaseDatabase name

    Oracle

    1. Copy ojdbc6.jar to <Tomcat installation directory>/lib
    2. Navigate to <Tomcat installation directory>/conf
    3. Add datasource context.xml as given below:
      <Resource name="jdbc/kpnsdb" auth="Container" type="javax.sql.DataSource" scope="Shareable"
      factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" maxActive="30" minIdle="1" maxIdle="10" testWhileIdle="true"
      maxWait="10000" initialSize="10" testOnBorrow="true" validationQuery="select 1 from dual" removeAbandoned="false"
      removeAbandonedTimeout="180" logAbandoned="false" username="username" password="password" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@host:port:sid"/>
    4. Replace the value given below in the above configuration.
      Configuration ValueDescription
      hostDatabase server IP/name
      portDatabase server port
      usernameDatabase user name
      passwordDatabase password
      sid Oracle service id/name

    DB2

    1. Copy db2jcc4.jar to <Tomcat installation directory>/lib
    2. Navigate to <Tomcat installation directory>/conf
    3. Add datasource context.xml as given below:
      <Resource name="jdbc/kpnsdb" auth="Container" type="javax.sql.DataSource" scope="Shareable"factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" maxActive="30" minIdle="1" maxIdle="10"
      testWhileIdle="true" maxWait="10000" initialSize="10" testOnBorrow="true" validationQuery="select 1 FROM SYSIBM.SYSDUMMY1"
      removeAbandoned="false" removeAbandonedTimeout="180" logAbandoned="false" username="username" password="password"
      driverClassName="com.ibm.db2.jcc.DB2Driver" url="jdbc:db2://host:port/database:currentSchema=schemaname;progressiveStreaming=2;"/>
    4. Replace the values given below in the above configuration.
      Configuration ValueDescription
      hostDatabase server IP/name
      portDatabase server port
      username Database user name
      passwordDatabase password
      databaseDatabase name
      schemanameSchema name

    SQLServer

    1. Copy sqljdbc4.jar to <Tomcat installation directory>/lib
    2. Navigate to <Tomcat installation directory>/conf
    3. Add datasource context.xml as given below.
      <Resource name="jdbc/kpnsdb" auth="Container" type="javax.sql.DataSource" scope="Shareable"factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" maxActive="50" minIdle="1" maxIdle="10" testWhileIdle="true" maxWait="10000" initialSize="10" testOnBorrow="true" validationQuery="SELECT 1" removeAbandoned="false"
      removeAbandonedTimeout="180" logAbandoned="false" username="username" password="password" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://host:port;databaseName=database;user=username;
      password=password;sendStringParametersAsUnicode=true;"/>
    4. Replace the value given below in above configuration.
      Configuration ValueDescription
      hostDatabase server IP/name
      portDatabase server port
      usernameDatabase user name
      passwordDatabase password
      databaseDatabase name

Deploy Engagement Services

  1. To deploy Kony Fabric Engagement Services on Tomcat Server, copy kpns.war file to the following location:

    <Tomcat installation directory>/webapps/

  2. After you deploy Kony Fabric Engagement Services, complete the Kony Fabric Engagement Services setup and start the Tomcat Server.

Post Upgrade

To start Tomcat server, post upgrade follow these steps:

  1. Clean up tomcat work directory.

    <Tomcat installation directory>/work/Catalina/<host>/

  2. Remove kpns folder in the above path and re-start Tomcat service.
Copyright © 2015 Temenos AG. All rights reserved.